<template>
	<el-card class="box-card">
	  <ul class="msg-box">
		<li>
		  <h4>我要充值</h4>
		</li>
		<li>
		  <h4 style="margin-bottom: 15px">充值金额</h4>
		  <el-radio-group v-model="amountVal" @change="amountChange">
			<el-radio border :label="''+100">充值100</el-radio>
			<el-radio border :label="''+500">充值500</el-radio>
			<el-radio border :label="''+1000">充值1000</el-radio>
			<el-radio border :label="''+2000">充值2000</el-radio>
			<el-radio border :label="''+5000">充值5000</el-radio>
			<el-radio border :label="''">自定义</el-radio>
		  </el-radio-group>
		</li>
  
		<li>
		  <h4 style="margin-bottom: 15px">充值方式</h4>
		  <el-radio-group v-model="rechargeParams.paymentType" @change="paymentTypeChange">
			<el-radio border :label="'' + 0">微信</el-radio>
			<el-radio border :label="'' + 1">支付宝</el-radio>
		  </el-radio-group>
		</li>
  
		<li>
		  <h4 style="margin-bottom: 15px">充值金额</h4>
		  <el-input
			:disabled="disabled"
			clearable
			v-model="rechargeParams.totalAmt"
			placeholder="请输入金额"
			style="width: 150px"
		  ></el-input>
		</li>
	  </ul>
	  <div style="text-align: center; margin-top: 30px">
		<el-button type="primary" @click="surePay">确认支付</el-button>
	  </div>
	  <payImage :dialogData="dialogData"></payImage>
	</el-card>


  </template>
  
  <script>
	import payImage from "./payImage.vue";
  export default {
name:'money',
components: {
	payImage
    },
	data() {
	  return {
		
		dialogData: {
                // 拥护id，如果为0则表示不存在的用户，也就是添加用户
                // type:this.rechargeParams.paymentType,
				// payfor:this.rechargeParams.totalAmt,
				type:'',
				payfor:"",
                // 是否显示编辑窗口
                showEditDialog: false,
            },

		amountVal: {
		
		},
		
		disabled: false,
		//充值参数
		rechargeParams: {
		  totalAmt: "", //金额
		  paymentType: "0", //支付方式[0:微信,1:支付宝]

		},
		
	  };
	},
  
	methods: {
	  //充值金额
	  amountChange(val) {
		this.rechargeParams.totalAmt = val;
		if (val == "") {
		  this.disabled = false;
		} else {
		  this.disabled = true;
		}
	  },
 
	  //支付方式
  
	  paymentTypeChange(val) {
		this.rechargeParams.paymentType = val;
	  },
  
	  //确认支付
  
	  surePay() {
		if (this.rechargeParams.totalAmt == "") {
		  this.$message.warning("请输入金额");
		  return;
		}
		this.dialogData = {
                showEditDialog: true,
				type:this.rechargeParams.paymentType,
				payfor:this.rechargeParams.totalAmt,
            };
	
	   },
	},
	
  };
  </script>
  
  <style scoped>
  /* 信息列表样式 */
  .msg-box > li {
	list-style: none;
	border-bottom: 1px solid #c5c5c5;
	padding: 20px 10px;
  }
  </style>
